package com.msh.frame.client.base;

import io.swagger.v3.oas.annotations.media.Schema;
import java.io.Serializable;
import java.util.Collection;
import lombok.ToString;

/**
 * @author shihu 基本的Qo类，查询类
 */
@Schema(title = "BaseQo")
@ToString
public abstract class BaseQo<T extends BaseQo> implements BasePageQo<T>, IConvert, Serializable {

  @Schema(title = "排序规则")
  protected SortBy[] sortBy;

  @Schema(title = "查询字段")
  protected String[] columns;

  @Schema(title = "主键ID in查询")
  private Collection<Long> idIn;

  public abstract Long getId();

  public abstract T setId(Long id);

  public SortBy[] getSortBy() {
    return sortBy;
  }

  public T setSortBy(SortBy... sortBy) {
    this.sortBy = sortBy;
    return (T)this;
  }

  public String[] getColumns() {
    return columns;
  }

  public T setColumns(String... columns) {
    this.columns = columns;
    return (T)this;
  }

  public Collection<Long> getIdIn() {
    return idIn;
  }

  public T setIdIn(Collection<Long> idIn) {
    this.idIn = idIn;
    return (T)this;
  }
}
